﻿using System.Collections;
using System.Collections.Specialized;

namespace MobileCommissionManagement.Framework
{
    public class ModelTools
    {
        public void Transfer<T>(T entity, IOrderedDictionary values)
        {
            var type = entity.GetType();
            foreach (DictionaryEntry value in values)
            {
                var propertyInfo = type.GetProperty((string)value.Key);
                propertyInfo.SetValue(entity, value.Value, null);
            }
        }
    }
}
